package org.lennon.demo.ddd.ticket.builder;

import org.lennon.demo.ddd.ticket.aggregate.Ticket;
import org.lennon.demo.ddd.ticket.entity.UserTicketEntity;

public class TicketBuilder {

    public static Ticket toTicket(UserTicketEntity userTicketEntity) {
        return new Ticket(userTicketEntity.getId(), userTicketEntity.getUserId(), userTicketEntity.getAmont());
    }

    public static UserTicketEntity fromTicket(Ticket ticket) {
        return new UserTicketEntity(ticket.getId(), ticket.getUserId(), ticket.getAmount());
    }
}
